package com.mmp.main.entity;

import java.io.Serializable;

import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQuery;

import org.hibernate.annotations.NotFound;
import org.hibernate.annotations.NotFoundAction;

import com.mmp.common.util.SearchRequired;

/**
 * The persistent class for the employee database table.
 *
 */

@Entity
@NamedQuery(name = "Employee.findAll", query = "SELECT e FROM Employee e WHERE e.status = 1 ORDER BY e.name")
public class Employee implements Serializable {
	private static final long serialVersionUID = 1L;

	@Id
	@GeneratedValue(strategy = GenerationType.IDENTITY)
	@Basic(optional = false)
	private Integer id;

	@ManyToOne
	@JoinColumn(name = "site_id")
	@NotFound(action = NotFoundAction.IGNORE)
	private Site site;

	@ManyToOne
	@JoinColumn(name = "department_id")
	@NotFound(action = NotFoundAction.IGNORE)
	private HospitalDepartment department;

	private String name;

	@Column(name = "name_en")
	private String nameEn;

	private String mobile;

	@Column(name = "job_title")
	private String jobTitle;

	@Column(name = "user_type")
	private Integer userType;

	@Column(name = "moving_team")
	private Boolean movingTeam;

	@SearchRequired
	private Boolean status;

	public Employee() {
	}

	public Integer getId() {
		return id;
	}

	public void setId(Integer id) {
		this.id = id;
	}

	public Site getSite() {
		return site;
	}

	public void setSite(Site site) {
		this.site = site;
	}

	public HospitalDepartment getDepartment() {
		return department;
	}

	public void setDepartment(HospitalDepartment department) {
		this.department = department;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getNameEn() {
		return nameEn;
	}

	public void setNameEn(String nameEn) {
		this.nameEn = nameEn;
	}

	public String getMobile() {
		return mobile;
	}

	public void setMobile(String mobile) {
		this.mobile = mobile;
	}

	public String getJobTitle() {
		return jobTitle;
	}

	public void setJobTitle(String jobTitle) {
		this.jobTitle = jobTitle;
	}

	public Integer getUserType() {
		return userType;
	}

	public void setUserType(Integer userType) {
		this.userType = userType;
	}

	public Boolean getMovingTeam() {
		return movingTeam;
	}

	public void setMovingTeam(Boolean movingTeam) {
		this.movingTeam = movingTeam;
	}

	public Boolean getStatus() {
		return status;
	}

	public void setStatus(Boolean status) {
		this.status = status;
	}

}
